package org.massi.imslp.query;


import de.tudarmstadt.ukp.wikipedia.parser.ParsedPage;
import de.tudarmstadt.ukp.wikipedia.parser.Section;
import de.tudarmstadt.ukp.wikipedia.parser.Template;


/**
 * Uses the visitor pattern to inspect the content of a {@link ParsedPage}
 */
public interface IParsedPageVisitor
{

	/**
	 * Invoked when parsing starts
	 * 
	 * @param page the page is going to be parsed
	 */
	void onPageStart(ParsedPage page);


	/**
	 * Invoked when a section is found
	 * 
	 * @param section the section to inspect
	 */
	void onSection(Section section);


	/**
	 * Invoked when a template is found
	 * 
	 * @param template the template to inspect
	 */
	void onTemplate(Template template);


	/**
	 * Invoked when a parameter is found, in the form of key/value
	 * 
	 * @param parameterName name of the parameter (can not be null)
	 * @param parameterValue value of the parameter (can be null)
	 */
	void onParameter(String parameterName, String parameterValue);


	/**
	 * Invoked when the parsing is complete
	 * 
	 * @param page page that has been parsed
	 */
	void onPageEnd(ParsedPage page);
}
